layui.use(['carousel'], function () {
    var carousel = layui.carousel;

    carousel.render({
        elem: '#carousel',
        width: '100%',
        arrow: 'hover',
        interval: 5000,
        anim: 'fade'
    });
});